# @Author   : 懒羊羊
# @File     : mym1.py
# @Time     : 2024/11/28 18:13
import logging

from dologs import DoLog


class MyClass:

    def __init__(self, cls_name, cls_num, cls_type, cls_cj):
        self.cls_name = cls_name
        self.cls_num = cls_num
        self.cls_type = cls_type
        self.cls_cj = cls_cj

    def get_High_Score(self):
        self.cls_cj.sort(reverse=True)
        a = self.cls_cj
        print(a[0])
        return a[0]

    def find(self, numx):
        b = 0
        found = False
        while b < len(self.cls_cj):

            if self.cls_cj[b] == numx:
                print(f"下标是{b}的结果是：{self.cls_cj[b]}")
                print(f"找到了")
                found = True
            b += 1
        if not found:
            print("没找到")

    def __sumadd(self):
        numadd = 0
        for i in range(101):
            if i % 2 == 0:
                numadd += i
        print(numadd)


dolog = DoLog().set_get_logger(logging.INFO)

if __name__ == '__main__':
    mylist = [87, 68, 99, 67, 60]
    myclass1 = MyClass("1班", 5, "rc", mylist)
    try:
        myclass1.find(70)
        myclass1.get_High_Score()
        myclass1.__sumadd()
    except Exception as e:
        logging.error(f"发生异常了,{e}")
    else:
        print("无异常发生")
    finally:
        print("我进行异常捕获了!")
